package com.easemob.chatuidemo.activity;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.webkit.WebView;
import android.widget.AdapterView;
import android.widget.TextView;

import com.wee.aircoach_user.R;

public class WebActivity extends Activity {
    private TextView txtTitle;
    private WebView webView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web);

        txtTitle = (TextView)findViewById(R.id.title);
        webView = (WebView)findViewById(R.id.webview);
        webView.getSettings().setJavaScriptEnabled(true);
        findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        String url = getIntent().getStringExtra("url");
        String title = getIntent().getStringExtra("title");

        if(url!=null&&url.length()!=0){
            webView.loadUrl(url);
        }
        if(title!=null&&title.length()!=0){
           txtTitle.setText(""+title);
        }
    }


}
